# Contributor: Philipp Glaum <p@pglaum.de>
# Maintainer: Philipp Glaum <p@pglaum.de>
pkgname=py3-babelfish
pkgver=0.6.1
pkgrel=0
pkgdesc="Work with countries and languages"
url="https://pypi.org/project/babelfish/"
arch="noarch"
license="BSD-3-Clause"
depends="py3-sphinx"
makedepends="py3-gpep517 py3-poetry-core"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/Diaoul/babelfish/archive/$pkgver.tar.gz"
builddir="$srcdir/babelfish-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
e5936b08f7ecf38beea3a2da2ee32cfd93f312548459c18370326a72011aed5ed8a1908b13a091979c3fe83a984b99f299ed6c3d39a47784b4d5c48145796d04  py3-babelfish-0.6.1.tar.gz
"
